package com.ptszyxx.popose.module.main.user.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.ptszyxx.popose.R;
import com.ptszyxx.popose.databinding.ItemUserDetailDynamicBinding;
import com.ysg.http.data.entity.dynamic.DynamicResult;
import com.ptszyxx.popose.module.main.user.vm.UserDetailDynamicVM;

public class UserDynamicAdapter extends BaseQuickAdapter<DynamicResult, BaseDataBindingHolder<ItemUserDetailDynamicBinding>> {
    private Presenter mPresenter = new Presenter();


    public UserDynamicAdapter() {
        super(R.layout.item_user_detail_dynamic);
    }

    @Override
    protected void convert(BaseDataBindingHolder<ItemUserDetailDynamicBinding> holder, DynamicResult item) {
        ItemUserDetailDynamicBinding binding = holder.getDataBinding();
        if (binding != null) {
            binding.setEntity(item);
//            binding.setViewModel(viewModel);
            binding.setPresenter(mPresenter);
            binding.setPosition(holder.getBindingAdapterPosition());
            binding.executePendingBindings();

            binding.dynamicImage.setData(item);
        }
    }

    public static class Presenter{
//        public void onItemClick(HomeVM viewModel, HomeResult entity){
//            viewModel.jumpPersonDetail(entity);
//        }
//        public void onHeartClick(HomeVM viewModel, HomeResult entity, int position){
//            viewModel.heart(entity, position);
//        }
//        public void onChatClick(HomeVM viewModel, HomeResult entity){
//            viewModel.jumpChat(entity);
//        }
    }








}
